package main

func duplicateZeros(arr []int) {
	var que = make([]int, len(arr))
	var j = 0
	var j2 = 0

	for i := 0; i < len(arr); i++ {
		if j2 < len(arr) {
			que[j2] = arr[i]
			j2++
		}
		if arr[i] == 0 && j2 < len(arr) {
			que[j2] = 0
			j2++
		}
		arr[i] = que[j]
		j++
	}
}

func duplicateZeros2(arr []int) {
	for i := 0; i < len(arr)-1; i++ {
		if arr[i] == 0 {
			arr = append(arr[:i+1], arr[i:len(arr)-1]...)
			i++
		}
	}
}
